home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / quicktime / goodies / chromakeymovie / eventloop.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  1.3 KB  |  60 lines

  1. /*
  2.     File:        eventloop.c
  3.  
  4.     Contains:    
  5.  
  6.     Written by: Jason Hodges-Harris        
  7.  
  8.     Copyright:    Copyright © 1995-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 7/28/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23.  
  24. // Mac toolbox headers
  25.  
  26. #ifndef __EVENTS__
  27. #include <Events.h>
  28. #endif
  29.  
  30.  
  31. // Program headers
  32.  
  33. #ifndef __CHROMAPPHEADER__
  34. #include "ChromaKeyMovie.h"
  35. #endif
  36.  
  37.  
  38. //    Global Variables
  39.  
  40. extern Boolean        gDone;                // program loop test condition
  41. extern Boolean        gMovieOpen;
  42.  
  43.  
  44. // EventLoop handles the application's main WNE loop
  45. // and is called from within the main() function.
  46.  
  47. #pragma segment Main
  48. void EventLoop (void)
  49. {
  50.     EventRecord    event;
  51.     
  52.     while (!gDone)
  53.     {
  54.         if (WaitNextEvent (everyEvent,&event,kSleep,nil) || gMovieOpen)
  55.         {
  56.             DoEvent (&event);
  57.         }
  58.     }
  59. }
  60.